/* stylelint-disable property-no-vendor-prefix */
/* stylelint-disable function-no-unknown */
@use "./override.system.scss";

:root {
  --el-mask-color: rgb(255 255 255 / 52%);
  --el-disabled-bg-color: var(--ik-input-disabled-bg);
}

.el-notification__group {
  width: 100%;
}

// 系统消息
.ik-sys-msg-no {
  width: 100%;
  display: block;
  text-align: center;
  background: var(--ik-input-bg);
  padding: 3px;
  border-radius: 3px;
  transition: all .25s ease-in-out;
  margin: 15px 0 5px;
  cursor: pointer;

  &:hover {
    color: var(--el-color-primary);
    background-color: var(--ik-input-hover-bg);
  }
}

// 列表页全局样式
.el-table.list-table {
  margin: 20px 0;

  .el-button+.el-dropdown {
    margin-left: 10px;
  }
}

.el-popper {
  border: none;
}

.el-form {
  --el-loading-spinner-size: 22px;
  --el-loading-fullscreen-spinner-size: 22px;
}

.ik-msg-box .el-message-box__message {
  &>p {
    word-break: break-all;
  }
}

// 表格表头背景色
.el-table th.el-table__cell,
.el-table.is-scrolling-none th.el-table-fixed-column--left,
.el-table.is-scrolling-none th.el-table-fixed-column--right,
.el-table__header-wrapper tr th.el-table-fixed-column--left,
.el-table__header-wrapper tr th.el-table-fixed-column--right {
  background-color: var(--ik-table-header-bg);
}

.el-table--enable-row-hover .el-table__body tr {
  td.el-table__cell {
    transition: background-color 0.25s;
  }

  &:hover>td.el-table__cell {
    background-color: var(--ik-table-hover-bg);
  }
}

.el-table {
  --el-table-header-text-color: var(--ik-table-header-color);
  --el-table-text-color: var(--ik-text-color);



  .el-table__body {
    td.el-table__cell {
      &.is-number .cell {
        padding-right: 16px;
      }
    }

    .tree-table-center td.el-table__cell .cell {
      display: flex;
      align-items: center;
    }
  }


  .el-table__body tr.hover-row>td.el-table__cell {
    background-color: var(--ik-table-hover-bg);
  }

  .el-checkbox {
    --el-checkbox-input-height: 24px;
    --el-checkbox-input-width: 24px;
    --el-checkbox-input-border: none;

    .el-checkbox__input {
      &.is-checked {
        .el-checkbox__inner {
          background-color: var(--el-checkbox-checked-bg-color);

          &::after {
            border-color: var(--el-checkbox-checked-icon-color);
          }
        }
      }

      &.is-indeterminate {
        .el-checkbox__inner {
          background-color: var(--el-checkbox-checked-bg-color);

          &::before {
            top: 11px;
          }
        }
      }
    }

    .el-checkbox__inner {
      background-color: var(--ik-checkbox-bg);
      border-radius: 6px;

      &::after {
        border-color: var(--ik-checkbox-bg);
        left: 9px;
        transform: rotate(45deg) scaleY(1);
        top: 5px;
        height: 10px;
        width: 5px;
      }
    }
  }

  .el-table--border::after,
  .el-table--border::before,
  .el-table--border .el-table__inner-wrapper::after,
  .el-table__inner-wrapper::before {
    background-color: transparent;
  }

  .el-avatar {
    --el-avatar-bg-color: var(--el-color-primary);
  }

  tr {
    transition: background-color 0.25s;
  }
}

.el-dialog {

  // 表格表头背景色
  .el-dialog__header {
    padding: calc(var(--base-padding) * 2) var(--el-dialog-padding-primary);
    margin-right: 0;
    background: var(--el-bg-color-page);
    border-radius: var(--el-dialog-border-radius);

    .el-dialog__headerbtn {
      top: 3px;
    }
  }

  .el-dialog__body {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 28px 32px; // var(--el-dialog-padding-primary);
  }
}

// text按钮 文字间隔
.el-button__text--expand,
el-button .is-text {
  letter-spacing: 0.2em;
  margin-right: -0.2em;
}

.el-button {

  // text按钮 padding
  &.is-text {
    padding: var(--base-p);

    &:hover {
      background-color: transparent;
      opacity: 0.8;
    }

    &:not(.is-disabled, .el-button--danger):hover,
    &:not(.is-disabled, .el-button--danger):focus {
      background-color: transparent;
      color: var(--el-color-primary);
      opacity: 0.8;
    }

    &.is-text:not(.is-disabled, .is-has-bg):hover,
    .el-button.is-text:not(.is-disabled):focus {
      background-color: transparent;
      opacity: 0.8;
    }

  }
}

.el-dialog__footer,
.el-message-box__btns,
.ik-page-header .el-button:not(.is-icon) {
  min-width: 88px;
}

.el-button:not(.is-disabled):hover {
  --ik-main-icon-deep-color: var(--el-color-primary);
  --ik-main-icon-color: var(--ik-theme-color-re);
}

.el-button.is-link:not(.is-disabled):hover {
  color: var(--el-color-primary);
  background-color: transparent;
}

// 表单label :
.el-form-item .el-form-item__label {
  word-break: break-all;
  text-overflow: ellipsis;
  padding: 0 var(--base-padding) 0 0;
  display: flex;
  align-items: center;
  height: var(--el-component-size) !important;
  line-height: inherit;
  user-select: none;
  // 防止el-form-label触发事件
  pointer-events: none;
  // line-height: var(--el-component-size) !important;

  // 自动添加label后的:  需要时放开
  // &::after {
  //   content: "";
  //   position: relative;
  //   padding-left: 1px;
  // }
}

// 模态框底部按钮栏
.el-dialog__footer {
  border-top: 1px solid var(--ik-border-color);
  padding: 10px var(--el-dialog-padding-primary);
}

// 表格行固定padding
.el-table--large .cell {
  padding: 0 12px;
}

// card标题颜色
.el-card__header {
  color: var(--el-text-color-primary);
  padding: calc(var(--el-card-padding) - 8px) var(--el-card-padding);
  border-bottom-color: var(--el-border-color);
}

// 弹框中下拉选择器默认和输入框一样撑满
.el-form-item__content {
  .el-select.el-select--default,
  .el-input-number {
    width: 100%;
  }
}

.el-input-number {
  &.is-disabled {
    .el-input-number__decrease,
    .el-input-number__increase {
      background: var(--ik-input-disabled-bg);
    }
  }
}

.el-input.is-disabled {
  .el-input__wrapper {
    background-color: var(--ik-input-disabled-bg);
    color: var(--el-text-color-disabled);

    &:hover {
      background-color: var(--ik-input-disabled-bg);
    }
  }
}

.el-select .el-input.is-disabled {
  .el-input__wrapper {
    background-color: var(--ik-input-disabled-bg);

    &:hover {
      background-color: var(--ik-input-disabled-bg);
    }
  }
}

// switch false时背景色过亮
.el-switch {
  --el-switch-off-color: var(--el-text-color-secondary);

  height: var(--el-component-size);
}

// drawer__header默认距离底部margin
.el-drawer__header {
  margin-bottom: 0;
  padding-bottom: calc(var(--base-p) * 2);
  background: var(--el-bg-color-page);
  // color: var(--el-color-primary);
  font-weight: bold;
}

@media only screen and (max-width: 1350px) {
  .el-col-lg-6 {
    display: block;
    max-width: 50%;
    flex: 0 0 50%;
  }

  .el-col-lg-12 {
    max-width: 100%;
    flex: 0 0 100%;
  }
}

// 查询自动生成表单样式
.auto-search-form .el-form-item {
  border-radius: var(--el-border-radius-base); // var(--el-input-border-radius, var(--el-border-radius-base));
  transition: var(--el-transition-box-shadow);
  background-color: var(--ik-input-bg);
  padding-left: 11px;

  .el-input__wrapper {
    box-shadow: 0 0 0 1px #fff0 inset;
  }

  .el-form-item__label {
    color: var(--el-text-color-regular);
    font-weight: 600;
  }

  .el-select:hover:not(.el-select--disabled) .el-input__wrapper {
    box-shadow: 0 0 0 1px #fff0 inset;
  }

  .el-select .el-input.is-focus .el-input__wrapper {
    box-shadow: 0 0 0 1px #fff0 inset !important;
  }

  .el-select,
  .select-trigger {
    --el-select-input-focus-border-color: transparent;

    border: none;
  }

  .el-date-editor.el-input,
  .el-date-editor.el-input__wrapper {
    width: 100%;
  }
}

.el-date-editor.el-input,
.el-date-editor.el-input__wrapper {
  width: 100%;
}

.el-form-item {
  background: var(--el-bg-color);
  box-shadow: unset;

  .el-form-item__content {
    line-height: inherit;
  }
}

.el-form--default.el-form--label-top .el-form-item .el-form-item__label {
  // margin-bottom: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
}

// 解决存在行号且是树形表格式样式错误
tbody .fix-index-table-tree {
  .cell {
    line-height: 32px;
  }

  .el-table__placeholder {
    display: none;
  }
}

.el-table th.el-table__cell.is-leaf,
.el-table td.el-table__cell {
  border-bottom: 1px solid var(--ik-table-border-color);
}

.gl-search-form-popper {
  .el-checkbox-group {
    max-height: 40vh;
    overflow-y: auto;
  }
}

.is-circle.el-tooltip__trigger {
  span {
    display: none;
  }
}

input {
  caret-color: var(--el-color-primary);
  caret-width: 2px;
}

.el-input {
  .el-input__inner {
    min-height: var(--el-input-inner-height) !important;
  }

  .el-input__count {
    background-color: transparent !important;
  }

  .el-input__count .el-input__count-inner {
    background-color: transparent;
  }

  .el-input__wrapper {
    transition: background-color 0.25s;
    box-shadow: none !important;
  }

  .el-input__wrapper:hover {
    background-color: var(--ik-input-hover-bg);
  }

  .el-input__wrapper.is-focus {
    background-color: var(--ik-input-focus-bg);
  }
}

.el-card.no-border {
  border: none;

  .el-card__header {
    border: none;
  }

  &.border-left .el-card__header {
    border-left: 6px solid var(--el-color-primary);
    padding: 0 var(--el-card-padding);
  }
}

.is-error {
  .el-input__wrapper,
  .el-textarea__inner {
    background-color: var(--ik-input-error-bg);
  }

}

.el-textarea {
  .el-textarea__count {
    background-color: transparent !important;
  }

  .el-textarea__count .el-textarea__count-inner {
    background-color: transparent;
  }

  .el-textarea__inner {
    transition: background-color 0.25s;
    box-shadow: none !important;
  }

  &:not(.is-disabled) .el-textarea__inner:hover {
    background-color: var(--ik-input-hover-bg);
  }

  &:not(.is-disabled) .el-textarea__inner.is-focus {
    background-color: var(--ik-input-focus-bg);
  }
}

// UI规范配置
.el-table--default {
  .el-table__header {
    height: 48px;
  }

  .el-table__body {
    .el-table__row {
      height: 72px;
    }
  }
}

.el-textarea .el-input__count {
  background-color: transparent;
}

.el-sub-menu .el-icon {
  margin-right: 0;
}

.el-input__wrapper,
.el-textarea__inner {
  background-color: var(--ik-input-bg);
}

.el-pagination {
  color: var(--ik-pagin-text-color);

  .el-input__inner,
  .el-input__suffix,
  .el-pagination__jump {
    color: var(--ik-pagin-text-color);
  }
}

.el-tag {
  .el-tag__content {
    display: flex;
    align-items: center;

    :first-child {
      margin-right: 1px;
      display: flex;
      align-items: center;
    }
  }
}

.el-tree {
  .el-icon {
    &.el-tree-node__expand-icon svg {
      color: transparent;
      background-image: url("@/assets/icons/toggle-open-60.svg");
      background-size: 18px;
      background-repeat: no-repeat;
      background-position: center;
    }

    &.is-leaf svg {
      background-image: none;
    }
  }

  .el-tree-node.is-expanded.is-focusable {
    &>.el-tree-node__content {
      color: var(--ik-text-color);

      .el-icon {
        svg {
          background-image: url("@/assets/icons/toggle-open.svg");
        }

        &.is-leaf svg {
          background-image: none;
        }
      }
    }

    .is-current>.el-tree-node__content {
      color: var(--ik-header-menu-active-color);
      background-color: var(--ik-header-menu-active-bg);
    }
  }

  .el-tree-node {
    .el-tree-node__content {
      height: 40px;
      transition: background-color .25s;
      border-radius: 6px;
    }
  }
}

.el-table__empty-block {
  background-image: url("@/assets/icons/empty.svg");
  background-size: 100% 100%;
  background-position-y: -20px;
  background-repeat: no-repeat;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  position: relative;

  .el-table__empty-text {
    position: absolute;
    bottom: 10px;
    line-height: 1;
  }
}

.el-message-box.ik-msg-box {
  .el-button {
    border: none;

    &:not(.el-button--primary):first-child {
      background-color: var(--el-fill-color-light);

      &:hover {
        background-color: var(--el-fill-color);
      }
    }
  }

}

.ik-svg-icon-popover {
  width: auto !important;
}

.el-input__inner {
  font-family: var(--el-font-family);
}

.el-input-group__append,
.el-input-group__prepend {
  background-color: var(--el-color-info-light-8);
}


.el-overlay.is-message-box {
  z-index: 9999;
}
